/**
 * 您的公司.com
 * Copyright (c) 2018-2018 All Rights Reserved.
 */
package com.mei.demo;

import java.util.Iterator;
import java.util.Set;

import redis.clients.jedis.Jedis;

/**
 * 
 *
 * @author mei.xiaoliang@qq.com
 */
public class RedisKeyJava {

    @SuppressWarnings("resource")
    public static void main(String[] args) {
        // 连接本地的 Redis 服务
        Jedis jedis = new Jedis("localhost");
        System.out.println("连接成功");
        // 获取数据并输出
        Set<String> keys = jedis.keys("*");
        Iterator<String> it = keys.iterator();
        while (it.hasNext()) {
            String key = it.next();
            System.out.println(key);
        }
    }

}